<?php
require_once('pworks/common/log/LogEntity.class.php');

class Logs{
	/**
	 * 
	 *
	 * @var ILog[]
	 */
	public $_logs;
	
	public function start($headLines, $hasReport=false){
		foreach($this->_logs as $log){
			$log->hasReport = $hasReport;
			foreach($headLines as $line){
				$log->writeLine($line);
			}
			$log->start();
		}
	}

	public function addEntity(LogEntity $entity){
		foreach($this->_logs as $log){
			$log->addEntity($entity);
		}	
	}

	public function end(){
		foreach($this->_logs as $log){
			$log->end();
		}
	}

	public function report(){
		foreach($this->_logs as $log){
			$rpts = $log->getReport();
			$log->writeLine('---STATISTIC---');
			foreach($rpts as $key => $value){
				$log->writeLine($key . ': ' . $value);
			}
		}
	}
	
	public function close(){
	foreach($this->_logs as $log){
			$log->close();
		}
	}
}

